package biz

import (
	"context"
)

type Location struct {
	Latitude  float64
	Longitude float64
}

type LocationStatus struct {
	Location *Location
	FeeCent  int32
	KmDriven float64
	PoiName  string
}

type Trip struct {
	Id         string
	AccountId  string
	CarId      string
	Start      *LocationStatus
	Current    *LocationStatus
	End        *LocationStatus
	Status     TripStatus
	IdentityId string
}

type TripStatus int32

const (
	TripStatus_TS_NOT_SPECIFIED TripStatus = 0
	TripStatus_IN_PROGRESS      TripStatus = 1
	TripStatus_FINISHED         TripStatus = 2
)

type TripRepo interface {
	CreateTrip(context.Context, *Trip) (*Trip, error)
	UpdateTrip(context.Context, *Trip) (*Trip, error)
}

func (uc *TripUsecase) Create(ctx context.Context, t *Trip) (*Trip, error) {
	return uc.repo.CreateTrip(ctx, t)
}

func (uc *TripUsecase) Update(ctx context.Context, t *Trip) (*Trip, error) {
	return uc.repo.UpdateTrip(ctx, t)
}
